package de.jmda.mproc.swingui;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

import de.jmda.util.fileset.DirectoryFileFilter;
import de.jmda.util.fileset.FileSetJavaFilesOnly;

/**
 *
 */
public class ListModelSourcesRootDirectoriesIncludes
		extends ListModelJavaSourceFiles
{
	private static final long serialVersionUID = -3836697523172692804L;

	public ListModelSourcesRootDirectoriesIncludes(
			FileSetJavaFilesOnly fileSetSources)
	{
		super(fileSetSources);

		Set<DirectoryFileFilter> directoryFilters =
				fileSetSources.getIncludeDirectoryFiltersRecursive();
	
		List<File> fileList = new ArrayList<File>();
		
		for (DirectoryFileFilter directoryFilter : directoryFilters)
		{
			fileList.add(directoryFilter.getDirectory());
		}
		
		files = fileList.toArray(new File[0]);
	}
}